package net.sk.china.front.service.product;

import com.baomidou.mybatisplus.extension.service.IService;
import net.sk.china.common.model.product.StoreProduct;
import net.sk.china.front.response.product.ProductDetailResponse;

/**
 * StoreProductService 接口
 * +----------------------------------------------------------------------
 * | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2018-2024 聊来All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">apache</a> )
 * +----------------------------------------------------------------------
 * | @Author: 聊来 <18970881148@qq.com>
 * +----------------------------------------------------------------------
 * | DateTime: 2024/6/12 16:06
 * +----------------------------------------------------------------------
 */
public interface StoreProductService extends IService<StoreProduct> {

    /**
     * 获取商品详情
     * @param id 商品编号
     * @param type normal-正常，void-视频
     * @return {@code ProductDetailResponse}
     */
    ProductDetailResponse getDetail(Integer id, String type);

    /**
     * 获取购物车商品信息
     * @param productId 商品编号
     * @return {@code StoreProduct}
     */
    StoreProduct getCartByProId(Integer productId);

    /**
     * 添加/扣减库存
     * @param id 商品id
     * @param num 数量
     * @param type 类型：add—添加，sub—扣减
     * @return {@code boolean}
     */
    boolean operationStock(Integer id, Integer num, String type);
}
